package com.jingyanku.service.impl;

import com.base.service.impl.ServiceImpl;
import com.jingyanku.pojo.Category;
import com.jingyanku.service.ICategoryService;

public class CategoryServiceImpl<T extends Category> extends ServiceImpl<T>
		implements ICategoryService<T> {

	@Override
	public boolean create(T category) {

		if (dao.createQuery(
				" from Category c where c.name = '" + category.getName()
						+ "' and c.deleted = false ").list().size() > 0) {

			return false;
		} else {

			dao.create(category);
			return true;
		}

	}
}
